home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / remote / raopp.zip / EXIST.PAS next >
Pascal/Delphi Source File  |  1990-07-14  |  588b  |  32 lines

  1. {  Unit EXIST - Test Existance of 'Filename'  }
  2. {  Copyright (C) 1990 RodentWare  }
  3. {  Michael Reece/James Calvert * 1:3801/42  }
  4.  
  5. (*
  6.   Example:
  7.     If FileExist('CONFIG.SYS') then
  8.       Writeln ('Configuration file found!')
  9.     else
  10.       Writeln('Configuration file missing!');
  11. *)
  12.  
  13. Unit Exist;
  14.  
  15. Interface
  16.  
  17. Function FileExist(FileName:String):Boolean;
  18.  
  19. Implementation
  20.  
  21. Function FileExist(FileName:String):Boolean;
  22. Var F : File;
  23. Begin
  24.   {$I-}
  25.   Assign(F,FileName);
  26.   Reset(F);
  27.   Close(F);
  28.   {$I+}
  29.   FileExist:=(IOResult = 0) and (FileName <> '');
  30. End;
  31.  
  32. End.